{% extends "common/layout_main.html" %}
{% block content %}
<div class="row  border-bottom">
    <div class="col-lg-12">
        <div class="tab_title">
            <ul class="nav nav-pills">
                <li class="current">
                    <a href="{{ url_for('member_page.index') }}">会员列表</a>
                </li>
                <li>
                    <a href="{{ url_for('member_page.comment') }}">会员评论</a>
                </li>
            </ul>
        </div>
    </div>
</div>
<div class="row m-t">
    <div class="col-lg-12">
        <div class="row">
            <div class="col-lg-12">
                <div class="m-b-md">
                    <a class="btn btn-outline btn-primary pull-right" href="{{ url_for('member_page.edit') }}?id={{ member.id }}">
                        <i class="fa fa-pencil"></i> 编辑
                    </a>
                    <h2>会员信息</h2>
                </div>
            </div>
        </div>
        <div class="row" style="font-size:16px;">
            <div class="col-lg-2 text-center">
                <img class="img-circle circle-border" src="/static/images/member/{{ member.avatar }}"
                     width="100px" height="100px">
            </div>
            <div class="col-lg-10">
                <p class="m-t">昵称：{{ member.nickname }}</p>
                <p>性别：{% if member.sex == 1%}男{% elif member.sex == 0 %}女{% endif %}</p>
            </div>
        </div>
        <div class="row m-t">
            <div class="col-lg-12">
                <div class="panel blank-panel">
                    <div class="panel-heading">
                        <div class="panel-options">
                            <ul class="nav nav-tabs">
                                <li class="active">
                                    <a href="#tab-1" data-toggle="tab" aria-expanded="false">会员订单</a>
                                </li>
                                <li>
                                    <a href="#tab-2" data-toggle="tab" aria-expanded="true">会员评论</a>
                                </li>
                            </ul>
                        </div>
                    </div>

                    <div class="panel-body">
                        <div class="tab-content">
                            <div class="tab-pane active" id="tab-1">
                                <table class="table table-striped">
                                    <thead>
                                    <tr>
                                        <th>订单编号</th>
                                        <th>支付时间</th>
                                        <th>支付金额</th>
                                        <th>订单状态</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                      {%  if order_info_list %}
                                        {% for item in order_info_list %}
                                    <tr>
                                       <td>{{ item.order_sn }}</td>
                                       <td>{{ item.pay_time }}</td>
                                       <td>{{ item.pay_price }}</td>
                                       <td>
                                            {% if item.status == 0 %}
                                            待发货
                                            {% elif item.status == 1 %}
                                            已完成
                                            {% elif item.status == -2 %}
                                            订单取消中
                                            {% elif item.status == -3 %}
                                            已取消
                                            {% endif %}
                                       </td>
                                    </tr>
                                        {% endfor %}
                                    {% else %}
                                         <td colspan="4">暂无订单</td>
                                    {% endif %}
                                    </tbody>
                                </table>
                            </div>
                            <div class="tab-pane" id="tab-2">
                                <table class="table table-striped">
                                    <thead>
                                    <tr>
                                        <th>评论时间</th>
                                        <th>食物</th>
                                        <th>评论内容</th>
                                        <th>评分</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr>
                                        {%  if comments_list %}
                                        {% for item in comments_list %}
                                    <tr>
                                        <td>{{ item.created_time }}</td>
                                        <td>{{ item.food_name }}</td>
                                        <td>{{ item.content }}</td>
                                        <td>{{ item.score }}</td>
                                    </tr>
                                         {% endfor %}
                                    {% else %}
                                         <td colspan="4">暂无评论</td>
                                    {% endif %}
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}
